{% extends "reg6/reg.html" %}
{% load i18n %}
{% load reg6_filters %}
{% block content %}
<div id="content-main">

{% if coupon_code %}
<p>
Coupon code: {{ coupon_code|upper }}
</p>

<p>
Please note coupon codes does not pay for non-free addon items.
</p>
{% else %}
<table>
<tr>
<td>Name:</td>
<td>{{ name }}</td>
</tr>
<tr>
<td>Email:</td>
<td>{{ email }}</td>
</tr>
<tr>
<td>Order Number:</td>
<td>{{ order }}</td>
</tr>
<tr>
<td>Amount:</td>
<td>{{ total|money }}</td>
</tr>
</table>
{% endif %}

<table border="1">
    <thead>
    <tr>
        <th>Registration Number</th>
        <th>Name</th>
        <th>Email</th>
        <th>Ticket</th>
        <th>Items</th>
        {% if not coupon_code %}
        <th>Amount</th>
        {% endif %}
    </tr>
    </thead>
    <tbody>
    {% for person in attendees %}
    <tr>
        <td>{{ person.id }}</td>
        <td>{{ person.first_name }} {{ person.last_name }}</td>
        <td>{{ person.email }}</td>
        <td>{{ person.badge_type.description }}</td>
        <td>
        {% for item in person.ordered_items.all %}
        * {{ item.description }} <br />
        {% endfor %}
        </td>
        {% if not coupon_code %}
        <td>{{ person.ticket_cost|money }}</td>
        {% endif %}
    </tr>
    {% endfor %}
    </tbody>
</table>

{% if already_paid_attendees %}
<p>
Already paid attendees charged on this order:
</p>

<table border="1">
    <thead>
    <tr>
        <th>Registration Number</th>
        <th>Name</th>
        <th>Email</th>
        <th>Ticket</th>
        <th>Items</th>
        <th>Amount</th>
    </tr>
    </thead>
    <tbody>
    {% for person in already_paid_attendees %}
    <tr>
        <td>{{ person.id }}</td>
        <td>{{ person.first_name }} {{ person.last_name }}</td>
        <td>{{ person.email }}</td>
        <td>{{ person.badge_type.description }}</td>
        <td>
        {% for item in person.ordered_items.all %}
        * {{ item.description }} <br />
        {% endfor %}
        </td>
        <td>{{ person.ticket_cost|money }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% endif %}

{% if kiosk %}
<p>
Thank you for registering!<br />
Please close this browser and go to the badge pickup area at registration
to pick up your badge.
</p>
{% else %}
<p>
<button type="button" onclick="window.print()">Print receipt</button>
</p>
{% endif %}

</div>
{% endblock %}

